﻿using MSL.CodeMatic.App_Code;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Bulid_Business : PageBase
{
    string table = "";
    string db = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        table = Request.QueryString["table"];     //数据库表名
        db = Request.QueryString["db"];     //数据库名
        if (!IsPostBack)
        {
            this.txt_Author.Value = Utility.Config.ConfigHelper.GetAppSettings("AUTHOR");
            this.txt_Email.Value = Utility.Config.ConfigHelper.GetAppSettings("EMAIL");
            this.txt_Company.Value = Utility.Config.ConfigHelper.GetAppSettings("Company");
            Action();
        }
    }
    public void Action()
    {
        Response.Buffer = true;
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "No-Cache");

        string action = HttpContext.Current.Request["action"];              //提交类型
        string pqFields = HttpContext.Current.Request["pqFields"];          //要显示字段
        object connectstring = HttpContext.Current.Session["Connectstring"];
        switch (action)
        {
            case "List"://加载列表
                using (DataTable dt = DBHelper.GetTableColumns(db, table, connectstring.ToString()))
                {
                    Response.Write(Utility.Json.JsonHelper.PqNoPageJson(dt, pqFields));
                    Response.End();
                }
                break;
            default:
                break;
        }
    }
}